package com.mywork.activity;

import android.content.Intent;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.ciko.code.base.BaseActicity;
import com.mywork.R;


/**
 * Created by HP on 2016/2/16.
 */
public class PollSurveyDetailActivity
        extends
        BaseActicity
{
	private int			 position;
	private TextView	 tvShould, tvStatus;
	private LinearLayout llPoll;
	private TextView	 tvBg, tvPoll, tvBg2;
						 
	@Override
	protected void initTopBar() {
		setTitle("投票详情");
		enableNavLeftImg();
	}
	
	@Override
	protected void initLayout() {
		setContentView(R.layout.activity_poll_detail);
	}
	
	@Override
	protected void initView() {
		tvStatus = (TextView) findViewById(R.id.tv_status);
		tvShould = (TextView) findViewById(R.id.tv_should);
		llPoll = (LinearLayout) findViewById(R.id.ll_poll);
		tvBg = (TextView) findViewById(R.id.tv_bg);
		tvBg2 = (TextView) findViewById(R.id.tv_bg2);
		tvPoll = (TextView) findViewById(R.id.poll_right_now);
		Intent intent = getIntent();
		position = intent.getIntExtra("position", -1);
		switch (position) {
			case 0:
				tvBg.setBackgroundResource(R.drawable.poll_not_chosen);
				tvBg.setOnClickListener(new View.OnClickListener()
				{
					@Override
					public void onClick(View view) {
						tvBg.setBackgroundResource(R.drawable.poll_chosen);
						tvBg2.setBackgroundResource(R.drawable.poll_not_chosen);
					}
				});
				tvBg2.setOnClickListener(new View.OnClickListener()
				{
					@Override
					public void onClick(View view) {
						tvBg2.setBackgroundResource(R.drawable.poll_chosen);
						tvBg.setBackgroundResource(R.drawable.poll_not_chosen);
						
					}
				});
				break;
			case 1:
				llPoll.setVisibility(View.VISIBLE);
				tvPoll.setVisibility(View.GONE);
				break;
			case 2:
				llPoll.setVisibility(View.VISIBLE);
				tvPoll.setVisibility(View.GONE);
				tvStatus.setText("已结束");
				tvStatus.setBackgroundColor(0xffc4c4c4);
				break;
				
		}
		
	}
	
	@Override
	protected void initAdapter() {
	
	}
	
	@Override
	protected void initDates() {
	
	}
	
	@Override
	protected void initListener() {
	
	}
}
